API Documentation
GridLayout.h
1 // GridLayout.h
3 //
5 
6 namespace nkWinUi
7 {
13  class GridLayout final : public Layout
14  {
15  public :
16 
22  GridLayout (MainSystem* parentSystem) ;
27 
28  // Getters
33  Component* getComponentAt (unsigned int index) const ;
41  Component* getComponentAt (unsigned int x, unsigned int y) const ;
45  unsigned int getGridWidth () const ;
49  unsigned int getGridHeight () const ;
57 
58  // Setters
62  virtual void setParentComponent (Component* parent) override ;
69  void setGridWidth (unsigned int value) ;
76  void setGridHeight (unsigned int value) ;
82  void insertRow (unsigned int index) ;
88  void insertCol (unsigned int index) ;
94  void eraseRow (unsigned int index) ;
100  void eraseCol (unsigned int index) ;
107  void setFixedSizeRow (unsigned int rowIndex, unsigned int sizePix) ;
114  void setFixedSizeCol (unsigned int colIndex, unsigned int sizePix) ;
124  void setWeightRow (unsigned int rowIndex, float weight) ;
134  void setWeightCol (unsigned int colIndex, float weight) ;
140  void setInternalBorderWidth (unsigned int valuePix) ;
146  void setInternalBorderHeight (unsigned int valuePix) ;
156  void setIgnoreInternalBorderCell (unsigned int rowIndex, unsigned int colIndex, bool value) ;
157 
158  // Components
172  void addComponent (Component* component, int x, int y, int width, int height, bool resizeAllowed = false) ;
185  void updateComponentCellCoverage (Component* component, unsigned int x, unsigned int y, unsigned int width, unsigned int height, bool updateLayout = true) ;
196  virtual void removeComponent (Component* component) override ;
197 
198  // Update
202  virtual void update () override ;
203 
204  // Import / Export
208  virtual void exportClassToTree (nkExport::Node* rootNode) override ;
212  virtual void exportComponentsNodeEntry (nkExport::Node* rootNode) override ;
216  virtual void importClassFromTree (nkExport::Node* rootNode) override ;
220  virtual void processComponentsNodeEntry (nkExport::Node* rootNode) override ;
221  } ;
222 }
nkWinUi::GridLayout::getComponentAt
Component * getComponentAt(unsigned int index) const
nkWinUi::GridLayout::setWeightCol
void setWeightCol(unsigned int colIndex, float weight)
nkWinUi::GridLayout::getCellCoordinatesForPoint
nkMaths::Point getCellCoordinatesForPoint(const nkMaths::Point &point) const
nkWinUi::GridLayout::exportComponentsNodeEntry
virtual void exportComponentsNodeEntry(nkExport::Node *rootNode) override
nkWinUi::GridLayout::exportClassToTree
virtual void exportClassToTree(nkExport::Node *rootNode) override
nkWinUi::GridLayout::importClassFromTree
virtual void importClassFromTree(nkExport::Node *rootNode) override
nkWinUi::GridLayout::getComponentAt
Component * getComponentAt(unsigned int x, unsigned int y) const
nkWinUi::GridLayout::setFixedSizeCol
void setFixedSizeCol(unsigned int colIndex, unsigned int sizePix)
nkWinUi::GridLayout::GridLayout
GridLayout(MainSystem *parentSystem)
nkWinUi::Layout
Represents a layout to organize children of a component.
Definition: Layout.h:12
nkWinUi::GridLayout::setFixedSizeRow
void setFixedSizeRow(unsigned int rowIndex, unsigned int sizePix)
nkWinUi::GridLayout::update
virtual void update() override
nkWinUi::GridLayout::~GridLayout
~GridLayout()
nkWinUi::GridLayout::setWeightRow
void setWeightRow(unsigned int rowIndex, float weight)
nkWinUi::Component
Base class for any graphical component.
Definition: Component.h:12
nkWinUi::GridLayout::getGridHeight
unsigned int getGridHeight() const
nkWinUi::GridLayout::setIgnoreInternalBorderCell
void setIgnoreInternalBorderCell(unsigned int rowIndex, unsigned int colIndex, bool value)
nkWinUi::GridLayout::setInternalBorderWidth
void setInternalBorderWidth(unsigned int valuePix)
nkWinUi::GridLayout::getComponentCellCoverage
nkMaths::Rectangle getComponentCellCoverage(Component *component) const
nkExport::Node
A node in the tree structure representing the data to export / import.
Definition: Node.h:42
nkWinUi::MainSystem
The main system of the component.
Definition: MainSystem.h:18
nkMaths::Point
Represents a 2D Point.
Definition: Point.h:12
nkWinUi::GridLayout::insertRow
void insertRow(unsigned int index)
nkWinUi::GridLayout::addComponent
void addComponent(Component *component, int x, int y, int width, int height, bool resizeAllowed=false)
nkWinUi::GridLayout::eraseRow
void eraseRow(unsigned int index)
nkWinUi::GridLayout::insertCol
void insertCol(unsigned int index)
nkWinUi::GridLayout::setParentComponent
virtual void setParentComponent(Component *parent) override
nkWinUi::GridLayout::eraseCol
void eraseCol(unsigned int index)
nkWinUi::GridLayout::updateComponentCellCoverage
void updateComponentCellCoverage(Component *component, unsigned int x, unsigned int y, unsigned int width, unsigned int height, bool updateLayout=true)
nkWinUi::GridLayout::setInternalBorderHeight
void setInternalBorderHeight(unsigned int valuePix)
nkMaths::Rectangle
Represents a 2D rectangle.
Definition: Rectangle.h:12
nkWinUi::GridLayout::getGridWidth
unsigned int getGridWidth() const
nkWinUi::GridLayout
Implements a layout organizing children components in a grid.
Definition: GridLayout.h:14
nkWinUi
Encompasses all API of component NilkinsWinUi.
Definition: Button.h:7
nkWinUi::GridLayout::removeComponent
virtual void removeComponent(Component *component) override
nkWinUi::GridLayout::setGridWidth
void setGridWidth(unsigned int value)
nkWinUi::GridLayout::processComponentsNodeEntry
virtual void processComponentsNodeEntry(nkExport::Node *rootNode) override
nkWinUi::GridLayout::setGridHeight
void setGridHeight(unsigned int value)